import MIO
import StringOperation

path = "C:\\Users\\Main\\Desktop\\PythonTest\\"
read_filename = path + "text.txt"

file = MIO.file_read(read_filename)
boy_txt_list = list(filter(lambda x:StringOperation.is_alive(str(x),"男"),file))
girl_txt_list = list(filter(lambda x:StringOperation.is_alive(str(x),"女"),file))

substr_list = StringOperation.subsection(file,"=")

MIO.file_write(path+"篮.txt",boy_txt_list)
MIO.file_write(path+"铝.txt",girl_txt_list)

i = 1
for temp in substr_list:
    tempstr = path + "分" + str(i) + ".txt"
    MIO.file_write(tempstr,temp)
    i+=1


